package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.Device;
import com.ruoyi.system.mapper.DeviceMapper;
import com.ruoyi.system.service.DeviceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: ruohao
 * @Date: 2023/9/13
 **/
@Service
public class DeviceServiceImpl implements DeviceService {
    @Resource
    private DeviceMapper deviceMapper;

    @Override
    public List<Device> selectList(Device device) {
        return deviceMapper.selectList(device);
    }

    @Override
    public Device selectById(Long id) {
        return deviceMapper.selectById(id);
    }

    @Override
    public Boolean create(Device device) {
        return deviceMapper.insert(device) == 1;
    }

    @Override
    public Boolean update(Device device) {
        return deviceMapper.update(device) == 1;
    }

    @Override
    public Boolean deleteById(Long id) {
        return deviceMapper.deleteById(id) == 1;
    }

    @Override
    public List<Device> selectExList(Device device) {
        List<Device> exList = deviceMapper.selectExList(device);
        return exList;
    }
}
